<script setup lang="ts">
import { defineProps } from 'vue'

interface Props {
  icon: string
  text: string
  color: string
  onClick?: () => void
}

const props = defineProps<Props>()
</script>

<template>
  <div 
    class="nav-item"
    :style="{ '--hover-color': color }"
    @click="onClick"
  >
    <div class="nav-button">
      <i :class="['fa', icon]"></i>
      {{ text }}
    </div>
  </div>
</template>

<style scoped>
.nav-item {
  --hover-color: #1890ff;
  flex: 1;
  min-width: 180px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: #f8f9fa;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid #e4e7ed;
  color: #606266;
}

.nav-button:hover {
  background: #fff;
  border-color: var(--hover-color);
  color: var(--hover-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-button i {
  font-size: 20px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 为第一个导航项添加特殊样式 */
:deep(.nav-item:first-child) .nav-button {
  background: #e6f7ff;
  border-color: #1890ff;
  color: #1890ff;
}

:deep(.nav-item:first-child) .nav-button:hover {
  background: #f0f9ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(24, 144, 255, 0.15);
}
</style> 